package com.wumart.scaffold.web.common.exception;


import com.wumart.scaffold.web.common.enums.CodeMsg;

public class BaseRuntimeException extends RuntimeException {

    // 子类需要设置一个默认的异常返回状态码
    protected CodeMsg rspCodeMsg;

    public BaseRuntimeException() {
    }

    public BaseRuntimeException(CodeMsg codeMsg) {
        super(codeMsg.getMsg());
        this.rspCodeMsg = codeMsg;
    }

    public BaseRuntimeException(CodeMsg codeMsg, String message) {
        super(message);
        this.rspCodeMsg = codeMsg;
    }

    public BaseRuntimeException(CodeMsg codeMsg, String message, Throwable cause) {
        super(message, cause);
        this.rspCodeMsg = codeMsg;
    }

    public BaseRuntimeException(CodeMsg codeMsg, Throwable cause) {
        super(cause);
        this.rspCodeMsg = codeMsg;
    }

    public CodeMsg getRspCodeMsg() {
        return rspCodeMsg;
    }

    public void setRspCodeMsg(CodeMsg rspCodeMsg) {
        this.rspCodeMsg = rspCodeMsg;
    }
}
